package com.exposit.smarthouse.utils;

import com.exposit.smarthouse.model.*;

import java.util.*;

public class StartEnvironment {

    public static double getTemp()
    {
        return 35.5;
    }

    public static double getHumidity()
    {
        return 0.55;
    }
    public static double getSolidHumidity()
    {
        return 0.55;
    }

    public static double getLuminosity()
    {
        return 0.7;
    }
    public static double getSmoke()
    {
        return 0.2;
    }

    public static double getNoise()
    {
        return 60;
    }

    public static Double randomValue(IState iState)
    {
        Random random  = new Random();
        String type = iState.getType();
        if(type.equals("TEMP")) {
            return random.nextDouble() * (40.0 - 15.0) + 15.0;
        } else if(type.equals("HUMIDITY")) {
            return random.nextDouble() * (1.0 - 0.1) + 0.1;
        } else if(type.equals("SMOKE")) {
            return random.nextDouble() * (1.0 - 0.1) + 0.1;
        } else if(type.equals("NOISE")) {
            return random.nextDouble() * (170.0 - 30.0) + 30.0;
        } else if(type.equals("SOIL_HUM")) {
            return random.nextDouble() * (1.0 - 0.1) + 0.1;
        }else if(type.equals("SMOKE")) {
            return random.nextDouble() * (1.0 - 0.1) + 0.1;
        }
        return 0.0;
    }



}
